#ifndef CUBE_ACTORMANAGER_H_
#define CUBE_ACTORMANAGER_H_

struct	lua_State;
class	Body;

struct ActorTypeInfo
{
	typedef std::map< std::string, std::string >				Param;
	typedef Param::iterator										ParamIter;
	typedef std::map< std::string, std::vector< std::string > >	Func;
	typedef Func::iterator										FuncIter;

	lua_State*					L;
	Param						params;
	Func						funcs;

	Body*						body;
};

class ActorManager
{
friend class Actor;
friend class Pawn;

public :
	typedef std::map< std::string, ActorTypeInfo* >		TypeList;
	typedef TypeList::iterator							TypeListIter;

	static void					Register( const std::string& typeName, const std::string& filePath );
	static void					Unregister( const std::string& typeName );
	static void					UnregisterAll();
private :
	ActorManager(){}
	~ActorManager(){}
	
	static void					SetCommonEffect( const char* type, const char* path );
	static void					SetCommonMaterial( const char* type );
	static void					SetFunction( const char* format );
	static void					SetParameter( const char* format );
	static void					SetBody( const char* type, const char* path );

	static std::map< std::string, ActorTypeInfo* >		_types;
};

#endif